﻿@page "/datagrid/row-hover"

@using Syncfusion.Blazor.Grids
@using BlazorDemos
@using blazor_productdata
@inherits SampleBaseComponent;

<SampleDescription>
   <p>This sample demonstrates the DataGrid component with the row hover feature. Move the mouse over the DataGrid rows to see the hover effect.</p> 
</SampleDescription>
<ActionDescription>
   <p>Row Hover feature enables us to identify the current row by highlighting them on hovering the mouse over them. This can be enabled by setting the <code><a target='_blank' class='code' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableHover'>EnableHover</a></code> property as true.</p>
   <p>In this demo, you can move the mouse over DataGrid rows to see the hover effect.</p>
</ActionDescription>

<div class="col-lg-12 control-section">
    <div class="content-wrapper">
        <div class="row">

            <SfGrid DataSource="@GridData" AllowPaging="true" EnableHover="true">
                <GridPageSettings PageCount="5"></GridPageSettings>
                <GridColumns>
                    <GridColumn Field=@nameof(Product.ProductID) HeaderText="Product ID" TextAlign="TextAlign.Right"  Width="160"></GridColumn>
                    <GridColumn Field=@nameof(Product.ProductName) HeaderText="Product Name" Width="190"></GridColumn>
                    <GridColumn Field=@nameof(Product.UnitPrice) HeaderText="Unit Price" Format="C2" TextAlign="TextAlign.Right"  Width="170"></GridColumn>
                    <GridColumn Field=@nameof(Product.UnitsInStock) HeaderText="Units In Stock" TextAlign="TextAlign.Right"  Width="170"></GridColumn>                   
                    <GridColumn Field=@nameof(Product.Discontinued) HeaderText="Discontinued" Width="150" DisplayAsCheckbox=@true TextAlign="TextAlign.Center"  Type="ColumnType.Boolean"></GridColumn>
                </GridColumns>
            </SfGrid>

        </div>
    </div>
</div>

@code{

    public List<Product> GridData { get; set; }

    protected override void OnInitialized()
    {
        GridData = Product.GetAllRecords();
    }
}
